package remote.containers
{
	import remote.controls.Component;
	import remote.layouts.ILayout;
	import remote.layouts.PaddingLayout;
	
	
	/**
	 * 无外观的容器
	 * @author 银魂飞雪
	 * @createDate 2011-3-2
	 */
	public class Group extends Container implements IContainer
	{
		public function Group()
		{
			super();
		}
		
		override protected function createLayout():void
		{
			_layout = new PaddingLayout(this);
		}
		
		public function set paddingLeft(value:Number):void
		{
			if(paddingLeft != value)
			{
				(layout as PaddingLayout).paddingLeft = value;
				this.updateChildren();
			}
		}
		
		public function get paddingLeft():Number
		{
			return (layout as PaddingLayout).paddingLeft;
		}
		
		public function set paddingTop(value:Number):void
		{
			if(paddingTop != value)
			{
				(layout as PaddingLayout).paddingTop = value;
				this.updateChildren();
			}
		}
		
		public function get paddingTop():Number
		{
			return (layout as PaddingLayout).paddingTop;
		}
		
		public function set paddingRight(value:Number):void
		{
			if(paddingRight != value)
			{
				(layout as PaddingLayout).paddingRight = value;
				this.updateChildren();
			}
		}
		public function get paddingRight():Number
		{
			return (layout as PaddingLayout).paddingRight;
		}
		
		public function set paddingBottom(value:Number):void
		{
			if(paddingBottom != value)
			{
				(layout as PaddingLayout).paddingBottom = value;
				this.updateChildren();
			}
		}
		
		public function get paddingBottom():Number
		{
			return (layout as PaddingLayout).paddingBottom;
		}
		
		public function set padding(value:Number):void
		{
			(layout as PaddingLayout).paddingLeft = value;
			(layout as PaddingLayout).paddingTop = value;
			(layout as PaddingLayout).paddingRight = value;
			(layout as PaddingLayout).paddingBottom = value;
			updateChildren();
		}
		
		override public function set layout(value:ILayout):void
		{
			throw new Error("Group布局类型不允许更改");
		}
	}
}